//
//  ToolsController.m
//  云律司
//
//  Created by 韦淋 on 2017/7/20.
//  Copyright © 2017年 test. All rights reserved.
//

#import "ToolsController.h"

@interface ToolsController ()<JHPickerDelegate,UITextFieldDelegate,UIScrollViewDelegate>
{
    UIView *countView;
    BOOL isHaveDian;
}

@property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) NSArray *imageArray;
@property (nonatomic, strong) NSArray *placeHolderArray;
@property (nonatomic, strong) NSDictionary *log_Type;
@property (nonatomic, strong) NSDictionary *charge_Type;
@property (nonatomic, strong) NSDictionary *pay_Type;
@property (nonatomic, strong) NSArray *dataSource;
@property (nonatomic, assign) NSString *selectStr;
@property (nonatomic, assign) NSInteger seletTag;

@property (nonatomic, strong) NSArray *scdjArr;
@property (nonatomic, assign) NSInteger scdjIndex;
@property (nonatomic, strong) NSArray *ajlxArr;
@property (nonatomic, assign) NSInteger ajlxIndex;
@property (nonatomic, strong) NSArray *typeArr;
@property (nonatomic, assign) NSInteger typeIndex;
@property (nonatomic, strong) NSArray *rateTypeArr;
@property (nonatomic, assign) NSInteger rateTypeIndex;
@end

@implementation ToolsController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.automaticallyAdjustsScrollViewInsets = false;
    self.dataSource = [NSArray array];
    self.view.backgroundColor = [UIColor whiteColor];
    NSLog(@"log = %ld",self.log);
    NSLog(@"averagePay = %@",self.averagePay);
    [self initUI];
}
#pragma mark - Private Method
- (void)initUI{
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    scrollView.contentSize = CGSizeMake(0, SCREEN_HEIGHT);
    scrollView.delegate = self;
    
    
    UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT * 2)];
    backView.backgroundColor = [UIColor whiteColor];
    
    
    countView = [[UIView alloc] init];
    countView.hidden = YES;
    
    
    if (self.log == 1000) {
        self.barTitleLable.text = @"贷款利息计算";
        
        countView.frame = CGRectMake(10, 320, SCREEN_WIDTH - 20, 200);
        
        UILabel *warning = [[UILabel alloc] initWithFrame:CGRectMake(5, 10, 250, 30)];
        warning.textColor = [UIColor redColor];
        warning.text = @"*计算结果仅供参考";
        
        UILabel *deadLine = [[UILabel alloc] initWithFrame:CGRectMake(5, 50, 250, 30)];
        deadLine.tag = 1100;
        deadLine.font = [UIFont systemFontOfSize:13];
        
        UILabel *rate = [[UILabel alloc] initWithFrame:CGRectMake(5, 90, 250, 30)];
        rate.tag = 1101;
        rate.font = [UIFont systemFontOfSize:13];
        
        UILabel *interests = [[UILabel alloc] initWithFrame:CGRectMake(5, 130, 250, 30)];
        interests.tag = 1102;
        interests.font = [UIFont systemFontOfSize:13];
        
        UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 180, SCREEN_WIDTH - 20, 1)];
        line.backgroundColor = [UIColor lightGrayColor];
        
        [countView addSubview:warning];
        [countView addSubview:deadLine];
        [countView addSubview:rate];
        [countView addSubview:interests];
        [countView addSubview:line];
    }
    else if (self.log == 1001){
        self.barTitleLable.text = @"工伤赔偿计算";
        
        countView.frame = CGRectMake(10, 320, SCREEN_WIDTH - 20, 400);
        
        UILabel *warning = [[UILabel alloc] initWithFrame:CGRectMake(5, 10, 250, 30)];
        warning.textColor = [UIColor redColor];
        warning.text = @"*计算结果仅供参考";
        
        UILabel *total = [[UILabel alloc] initWithFrame:CGRectMake(80, 50, countView.bounds.size.width - 160, 30)];
        total.tag = 1220;
        total.textColor = [UIColor redColor];
        total.textAlignment = NSTextAlignmentCenter;
        total.font = [UIFont systemFontOfSize:13];
        
        
        for (int i = 0; i < 3; i ++) {
            UILabel *titleLable = [[UILabel alloc] init];
            titleLable.font = [UIFont systemFontOfSize:13];
            titleLable.textAlignment = NSTextAlignmentCenter;
            titleLable.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
            titleLable.tag = 1201 + i;
            [countView addSubview:titleLable];
        }
        for (int j = 0; j < 5; j ++) {
            UILabel *titleLable = [[UILabel alloc] init];
            titleLable.layer.borderWidth = 1;
            titleLable.font = [UIFont systemFontOfSize:12];
            titleLable.textAlignment = NSTextAlignmentCenter;
            titleLable.tag = 1204 + j;
            titleLable.layer.borderColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f].CGColor;
            
            UILabel *contentlable = [[UILabel alloc] init];
            contentlable.textAlignment = NSTextAlignmentCenter;
            contentlable.font = [UIFont systemFontOfSize:12];
            contentlable.textColor = [UIColor redColor];
            contentlable.layer.borderWidth = 1;
            contentlable.tag = 1209 + j;
            contentlable.layer.borderColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f].CGColor;

            [countView addSubview:titleLable];
            [countView addSubview:contentlable];
        }
        [countView addSubview:warning];
        [countView addSubview:total];

        
    }
    else if (self.log == 1002){
        self.barTitleLable.text = @"人身伤害赔偿计算";
    }
    else if (self.log == 1003){
        self.barTitleLable.text = @"律师费用计算";
        
        countView.frame = CGRectMake(10, 320, SCREEN_WIDTH - 20, 200);
        
        UILabel *warning = [[UILabel alloc] initWithFrame:CGRectMake(5, 10, 250, 30)];
        warning.textColor = [UIColor redColor];
        warning.text = @"*计算结果仅供参考";
        
        for (int i = 0; i < 3; i ++) {
            UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(10, 50  + i * 35, 90, 30)];
            titleLable.font = [UIFont systemFontOfSize:12];
            titleLable.textAlignment = NSTextAlignmentRight;
            titleLable.tag = 1300 + i;
            
            UILabel *contentLable = [[UILabel alloc] initWithFrame:CGRectMake(100, 50 + i * 35, 150, 30)];
            contentLable.textColor = [UIColor redColor];
            contentLable.font = [UIFont systemFontOfSize:12];
            contentLable.tag = 1303 + i;
        
            
            [countView addSubview:titleLable];
            [countView addSubview:contentLable];
        }
        [countView addSubview:warning];
    }
    else if (self.log == 1004){
        self.barTitleLable.text = @"诉讼费计算";
        
        countView.frame = CGRectMake(10, 270, SCREEN_WIDTH - 20, 200);
        
        UILabel *warning = [[UILabel alloc] initWithFrame:CGRectMake(5, 10, 250, 30)];
        warning.textColor = [UIColor redColor];
        warning.text = @"*计算结果仅供参考";
        [countView addSubview:warning];
        
        UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(10, 50, 90, 30)];
        titleLable.font = [UIFont systemFontOfSize:12];
        titleLable.textAlignment = NSTextAlignmentRight;
        titleLable.tag = 1400;
        
        UILabel *contentLable = [[UILabel alloc] initWithFrame:CGRectMake(100, 50 , 150, 30)];
        contentLable.textColor = [UIColor redColor];
        contentLable.font = [UIFont systemFontOfSize:12];
        contentLable.tag = 1401;
        
        
        [countView addSubview:titleLable];
        [countView addSubview:contentLable];
    }
    else if (self.log == 1005){
        self.barTitleLable.text = @"违约计算";
        
        countView.frame = CGRectMake(10, 370, SCREEN_WIDTH - 20, 220);
        
        UILabel *warning = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 250, 30)];
        warning.textColor = [UIColor redColor];
        warning.text = @"*计算结果仅供参考";
        [countView addSubview:warning];
        
        UILabel *interestRate = [[UILabel alloc] initWithFrame:CGRectMake(0, 150, 300, 30)];
        interestRate.textColor = [UIColor redColor];
        interestRate.font = [UIFont systemFontOfSize:13];
        interestRate.text = @"*利率换算：12 * 月利率 = 365 * 日利率 ";
        [countView addSubview:interestRate];
        
        UILabel *dedit = [[UILabel alloc] initWithFrame:CGRectMake(0, 180, 300, 30)];
        dedit.textColor = [UIColor redColor];
        dedit.font = [UIFont systemFontOfSize:13];
        dedit.text = @"*违约金换算：标的金额 * 逾期期限 * 利率";
        [countView addSubview:dedit];
        
        NSArray *titleArr = @[@"逾期期限：",@"利率：",@"违约金："];
        
        for (int i = 0; i < 3; i ++) {
            UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(0, 50 + i * 30, 80, 30)];
            titleLable.layer.borderWidth = 1;
            titleLable.text = titleArr[i];
            titleLable.font = [UIFont systemFontOfSize:12];
            titleLable.textAlignment = NSTextAlignmentRight;
            titleLable.tag = 1600 + i;
            titleLable.layer.borderColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f].CGColor;
            
            UILabel *contentlable = [[UILabel alloc] initWithFrame:CGRectMake(80, 50 + i * 30, 150, 30)];
            contentlable.font = [UIFont systemFontOfSize:12];
            contentlable.textColor = [UIColor redColor];
            contentlable.layer.borderWidth = 1;
            contentlable.tag = 1603 + i;
            contentlable.layer.borderColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f].CGColor;
            
            [countView addSubview:titleLable];
            [countView addSubview:contentlable];
        }
    }

    [self.view insertSubview:scrollView atIndex:0];
    [scrollView addSubview:backView];
    [scrollView addSubview:countView];
    
    for (int i = 0; i < self.titleArray.count; i ++) {
        
        
        UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(10, 80 + i * 50, self.view.bounds.size.width - 20, 40)];
        bgView.backgroundColor = [UIColor whiteColor];
        bgView.layer.borderWidth = 1.0f;
        bgView.layer.borderColor = [[UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f] CGColor];
        
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0,0, 40, 40)];
        view.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        
        UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(40, 0, 120, 40)];
        titleLable.textColor = [UIColor blackColor];
        titleLable.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        titleLable.font = [UIFont systemFontOfSize:13];
        titleLable.text = self.titleArray[i];
        
        [backView addSubview:bgView];
        [bgView addSubview:titleLable];
        
        UITextField *inputInfo = [[UITextField alloc] initWithFrame:CGRectMake(180, 80 + i * 50, 185, 40)];
        inputInfo.clearButtonMode = UITextFieldViewModeWhileEditing;
        inputInfo.textAlignment = NSTextAlignmentLeft;
        inputInfo.font = [UIFont systemFontOfSize:13];
        inputInfo.placeholder = self.placeHolderArray[i];
        inputInfo.delegate = self;
        
        UIButton *button_textFiled = [[UIButton alloc] initWithFrame:CGRectMake(180, 80 + i * 50, 185, 40)];
        [button_textFiled addTarget:self action:@selector(textFieldsDidClick:) forControlEvents:(UIControlEventTouchUpInside)];
        
        
        if (self.log == 1000) {
            inputInfo.tag = i + 100;
            button_textFiled.tag = i + 100;
            button_textFiled.hidden = YES;
            inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
        }
        if (self.log == 1001) {
            inputInfo.tag = i + 200;
            button_textFiled.tag = i+200;
            if (i == 0 || i == 1) {
                inputInfo.text = self.selectStr;
                inputInfo.userInteractionEnabled = NO;
                button_textFiled.hidden = NO;
            }
            else{
                inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
                button_textFiled.hidden = YES;
            }
        }
        if (self.log == 1002) {
            inputInfo.tag = i + 300;
            button_textFiled.tag = i+300;
            button_textFiled.hidden = YES;
        }
        if (self.log == 1003) {
            button_textFiled.tag = i+400;
            inputInfo.tag = i + 400;
            if (i == 0 || i == 1) {
                inputInfo.text = self.selectStr;
                inputInfo.userInteractionEnabled = NO;
                button_textFiled.hidden = NO;
            }
            else{
                inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
                button_textFiled.hidden = YES;
            }
        }
        if (self.log == 1004) {
            button_textFiled.tag = i+500;
            inputInfo.tag = i + 500;
            if (i == 0) {
                inputInfo.userInteractionEnabled = NO;
                inputInfo.text = self.selectStr;
                button_textFiled.hidden = NO;
            }
            else{
                inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
                button_textFiled.hidden = YES;
            }
        }
        if (self.log == 1005) {
            button_textFiled.tag = i+600;
            inputInfo.tag = i + 600;
            if (i == 3) {
                inputInfo.userInteractionEnabled = NO;
                inputInfo.text = self.selectStr;
                button_textFiled.hidden = NO;
            }
            else{
                inputInfo.keyboardType = UIKeyboardTypeDecimalPad;
                button_textFiled.hidden = YES;
            }
        }
        
        UIImageView *titleImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 20, 20)];
        titleImage.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        titleImage.image = [UIImage imageNamed:self.imageArray[i]];
        
        if (i == self.titleArray.count - 1) {
            UIButton *putInButton = [UIButton buttonWithType:UIButtonTypeCustom];
            putInButton.frame = CGRectMake(20, 80 + (i + 1) * 50 + 30, self.view.bounds.size.width - 40, 40);
            [putInButton setTitle:@"确认提交" forState:UIControlStateNormal];
            putInButton.titleLabel.textColor = [UIColor whiteColor];
            putInButton.layer.cornerRadius = 5;
            putInButton.layer.masksToBounds = YES;
            putInButton.backgroundColor = [UIColor colorWithRed:33.0f/255.0f green:180.0f/255.0f blue:237.0f/255.0f alpha:1.0f];
            [putInButton addTarget:self action:@selector(action_PutIn) forControlEvents:UIControlEventTouchUpInside];
            [backView addSubview:putInButton];
        }
        [bgView addSubview:titleImage];
        [backView addSubview:inputInfo];
        [backView addSubview:button_textFiled];
        [bgView insertSubview:view belowSubview:titleImage];
    }

    
    
    
    
    
    

}

#pragma mark - Button Target
- (void)action_PutIn{
    if (self.log == 1000) {
        UITextField *textField = [self.view viewWithTag:100];
        UITextField *textField1 = [self.view viewWithTag:101];
        UITextField *textField2 = [self.view viewWithTag:102];
        
        UILabel *lable = [self.view viewWithTag:1100];
        UILabel *lable1 = [self.view viewWithTag:1101];
        UILabel *lable2 = [self.view viewWithTag:1102];
        
        if (textField.tag == 100 && textField.text.length == 0) {
            NSLog(@"贷款金额不为空 ");
            [MBProgressHUD showError:@"请填写贷款金额"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        if (textField1.tag == 101 && textField1.text.length == 0){
            NSLog(@"还款期限不为空");
            [MBProgressHUD showError:@"请填写还款期限"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField2.tag == 102 && textField2.text.length == 0){
            NSLog(@"利率不为空");
            [MBProgressHUD showError:@"请填写利率"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        
        countView.hidden = NO;
        NSInteger count = [textField.text integerValue]*[textField1.text integerValue];
        float rate = [textField2.text floatValue];
        NSInteger interests = count*rate;
        NSLog(@"count = %ld",count);
        NSLog(@"rate = %.2f",rate);
        NSLog(@"interests = %ld",interests);
        lable.text = [NSString stringWithFormat:@"还款期限为： %@个月 ",textField1.text];
        lable1.text = [NSString stringWithFormat:@"利率为： %@%% ",textField2.text];
        lable2.text = [NSString stringWithFormat:@"利息为： %.2f",interests*0.01];
    }
    if (self.log == 1001) {
        
        
        UITextField *textField = [self.view viewWithTag:200];
        UITextField *textField1 = [self.view viewWithTag:201];
        UITextField *textField2 = [self.view viewWithTag:202];
        
        if (textField.tag == 200 && textField.text.length == 0) {
            NSLog(@"所在地区不为空 ");
            [MBProgressHUD showError:@"请选择所在地区"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        if (textField1.tag == 201 && textField1.text.length == 0){
            NSLog(@"伤残等级不为空");
            [MBProgressHUD showError:@"请选择伤残等级"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField2.tag == 202 && textField2.text.length == 0){
            NSLog(@"工资不为空");
            [MBProgressHUD showError:@"请填写月工资"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        [MBProgressHUD showHUDAddedTo:self.view animated:YES];
        [NetworkingManager getUrl:WORKCOVER_URL dic:@{@"qmarea_id":@"1",@"scdj":[NSString stringWithFormat:@"%ld",self.scdjIndex + 1]} Succeed:^(id responseData) {
            NSLog(@"success : %@",responseData);
            self.dataSource = responseData[@"result"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            
            countView.hidden = NO;
            if (self.scdjIndex == 0 || self.scdjIndex == 1 || self.scdjIndex == 2 || self.scdjIndex == 3                                                                                                                                                                                                                                                                                                                                                                             ) {
                
                NSArray *titleArr = @[@"补助金 ",@"伤残津贴 ",@"生活自理费 "];
                NSArray *titleArr1 = @[@"一次性伤残补助金 ",@"伤残津贴 ",@"部分不能自理 ",@"大部分不能自理 ",@"完全不能自理 "];
                NSString *pca = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pca"] floatValue] * [textField2.text floatValue]];
                NSString *pcb = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pcb"] floatValue] * [textField2.text floatValue]];
                NSString *bfhl = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"bfhl"] floatValue] * [textField2.text floatValue]];
                NSString *dbfhl = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"dbfhl"] floatValue] * [textField2.text floatValue]];
                NSString *wqhl = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"wqhl"] floatValue] * [textField2.text floatValue]];
                
                NSArray *contentArr = @[[NSString stringWithFormat:@"%@元 ",pca],[NSString stringWithFormat:@"%@元 ",pcb],[NSString stringWithFormat:@"%@元 ",bfhl],[NSString stringWithFormat:@"%@元 ",dbfhl],[NSString stringWithFormat:@"%@元 ",wqhl]];
                
                UILabel *totlal = [self.view viewWithTag:1220];
                totlal.text = [NSString stringWithFormat:@"总计： %.2f元 ",[pca floatValue] + [pcb floatValue] + [bfhl floatValue] + [dbfhl floatValue] + [wqhl floatValue]];
                
                for (int i = 0; i < 3; i ++) {
                    UILabel *titleLable = [self.view viewWithTag:1201 + i];
                    titleLable.hidden = NO;
                    titleLable.text = titleArr[i];
                    titleLable.frame = CGRectMake(0, 80 + i * 60, countView.bounds.size.width, 30);
                }
                for (int j = 0; j < 5; j ++) {
                    UILabel *titleLable = [self.view viewWithTag:1204 + j];
                    titleLable.text = titleArr1[j];
                    titleLable.hidden = NO;
                    
                    UILabel *contentlable = [self.view viewWithTag:1209 + j];
                    contentlable.text = contentArr[j];
                    contentlable.hidden = NO;
                    
                    if (j == 0) {
                        titleLable.frame = CGRectMake(0, 110, 200, 30);
                        contentlable.frame = CGRectMake(200, 110, 155, 30);
                    }
                    else if (j == 1){
                        titleLable.frame = CGRectMake(0, 170, 200, 30);
                        contentlable.frame = CGRectMake(200, 170, 155, 30);
                    }
                    else{
                        titleLable.frame = CGRectMake(0, 170 + j * 30, 200, 30);
                        titleLable.layer.borderWidth = 0.5;
                        
                        contentlable.frame = CGRectMake(200, 170 + j * 30, 155, 30);
                        contentlable.layer.borderWidth = 0.5;
                    }
                }
            }
            if (self.scdjIndex == 4 || self.scdjIndex == 5) {
                
                
                
                NSArray *titleArr = @[@"补助金 ",@"伤残津贴 ",@""];
                
                NSArray *titleArr1 = @[@"一次性伤残补助金 ",@"一次性工伤医疗补助金 ",@"一次性伤残就业补助金 ",@"伤残津贴 ",@""];
                
                NSString *pca = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pca"] floatValue] * [textField2.text floatValue]];
                NSString *pcc = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pcc"] floatValue] * [textField2.text floatValue]];
                NSString *pcd = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pcd"] floatValue] * [textField2.text floatValue]];
                NSString *pcb = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pcb"] floatValue] * [textField2.text floatValue]];
               
                NSArray *contentArr = @[[NSString stringWithFormat:@"%@元 ",pca],[NSString stringWithFormat:@"%@元 ",pcc],[NSString stringWithFormat:@"%@元 ",pcd],[NSString stringWithFormat:@"%@元 ",pcb],@""];
                
                UILabel *totlal = [self.view viewWithTag:1220];
                totlal.text = [NSString stringWithFormat:@"总计： %.2f元 ",[pca floatValue] + [pcc floatValue] + [pcd floatValue] + [pcb floatValue]];
                for (int i = 0; i < 3; i ++) {
                    UILabel *titleLable = [self.view viewWithTag:1201 + i];
                    titleLable.hidden = NO;
                    titleLable.text = titleArr[i];
                    titleLable.frame = CGRectMake(0, 80 + i * 60, countView.bounds.size.width, 30);
                    if (i == 1) {
                        titleLable.frame = CGRectMake(0, 200, countView.bounds.size.width, 30);
                    }else if (i ==2){
                        titleLable.hidden = YES;
                    }
                }
                
                
                for (int j = 0; j < 5; j ++) {
                    UILabel *titleLable = [self.view viewWithTag:1204 + j];
                    titleLable.text = titleArr1[j];
                    titleLable.hidden = NO;
                    
                    UILabel *contentLable = [self.view viewWithTag:1209 + j];
                    contentLable.text = contentArr[j];
                    contentLable.hidden = NO;
                    
                    if (j < 3) {
                        titleLable.frame = CGRectMake(0, 110 + j * 30, 200, 30);
                        titleLable.layer.borderWidth = 0.5;
                        
                        contentLable.frame = CGRectMake(200, 110 + j * 30, 200, 30);
                        contentLable.layer.borderWidth = 0.5;
                        
                    }
                    else if (j == 3){
                        titleLable.frame = CGRectMake(0, 230, 200, 30);
                        NSLog(@"lable : %@",titleLable);
                        
                        contentLable.frame = CGRectMake(200, 230, 200, 30);
                    }
                    else{
                        titleLable.hidden = YES;
                        contentLable.hidden = YES;
                    }
                }
            }
            if (self.scdjIndex == 6 || self.scdjIndex == 7 || self.scdjIndex == 8 || self.scdjIndex == 9) {
                
                
                
                NSArray *titleArr = @[@"补助金 ",@"",@""];
                
                NSArray *titleArr1 = @[@"一次性伤残补助金 ",@"一次性工伤医疗补助金 ",@"一次性伤残就业补助金 ",@"",@""];
                
                NSString *pca = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pca"] floatValue] * [textField2.text floatValue]];
                NSString *pcc = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pcc"] floatValue] * [textField2.text floatValue]];
                NSString *pcd = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pcd"] floatValue] * [textField2.text floatValue]];
                
                
                NSArray *contentArr = @[[NSString stringWithFormat:@"%@元 ",pca],[NSString stringWithFormat:@"%@元 ",pcc],[NSString stringWithFormat:@"%@元 ",pcd],@"",@""];
                
                UILabel *totlal = [self.view viewWithTag:1220];
                totlal.text = [NSString stringWithFormat:@"总计： %.2f元 ",[pca floatValue] + [pcc floatValue] + [pcd floatValue]];
                
                for (int i = 0; i < 3; i ++) {
                    UILabel *titleLable = [self.view viewWithTag:1201 + i];
                    titleLable.hidden = NO;
                    titleLable.text = titleArr[i];
                    titleLable.frame = CGRectMake(0, 80 + i * 60, countView.bounds.size.width, 30);
                    if (i > 0) {
                        titleLable.hidden = YES;
                    }
                }
                
                for (int j = 0; j < 5; j ++) {
                    
                    
                    UILabel *titleLable = [self.view viewWithTag:1204 + j];
                    titleLable.hidden = NO;
                    titleLable.text = titleArr1[j];
                    
                    UILabel *contentLable = [self.view viewWithTag:1209 + j];
                    contentLable.text = contentArr[j];
                    contentLable.hidden = NO;
                    
                    if (j < 3) {
                        titleLable.frame = CGRectMake(0, 110 + j * 30, 200, 30);
                        titleLable.layer.borderWidth = 0.5;
                        
                        contentLable.frame = CGRectMake(200, 110 + j * 30, 200, 30);
                        contentLable.layer.borderWidth = 0.5;
                        
                    }
                    else{
                        titleLable.hidden = YES;
                        contentLable.hidden = YES;
                    }
                }
            }
            
            if (self.scdjIndex == 10) {
                
                
                NSArray *titleArr = @[@"工亡补助金 ",@"丧葬补助金 ",@"亲属补助金 "];
                NSArray *titleArr1 = @[@"一次性工亡补助金 ",@"丧葬补助金 ",@"配偶 ",@"其他亲属 ",@""];
                
                NSString *pch = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pch"] floatValue] * [self.averagePay[0][@"avg_wag"] floatValue]];
                NSString *pce = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pce"] floatValue] * [self.averagePay[0][@"avg_wag"] floatValue]];
                NSString *pcf = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pcf"] floatValue] * [textField2.text floatValue]];
                NSString *pcg = [NSString stringWithFormat:@"%.2f",[self.dataSource[0][@"pcg"] floatValue] * [textField2.text floatValue]];
                
                NSArray *contentArr = @[[NSString stringWithFormat:@"%@元 ",pch],[NSString stringWithFormat:@"%@元 ",pce],[NSString stringWithFormat:@"%@元 ",pcf],[NSString stringWithFormat:@"%@元 ",pcg],@""];
                
                UILabel *totlal = [self.view viewWithTag:1220];
                totlal.text = [NSString stringWithFormat:@"总计： %.2f元 ",[pch floatValue] + [pce floatValue] + [pcf floatValue] + [pcg floatValue]];
                for (int i = 0; i < 3; i ++) {
                    UILabel *titleLable = [self.view viewWithTag:1201 + i];
                    titleLable.hidden = NO;
                    titleLable.text = titleArr[i];
                    titleLable.frame = CGRectMake(0, 80 + i * 60, countView.bounds.size.width, 30);
                }
                for (int j = 0; j < 5; j ++) {
                    UILabel *titleLable = [self.view viewWithTag:1204 + j];
                    titleLable.text = titleArr1[j];
                    titleLable.hidden = NO;
                    
                    UILabel *contentlable = [self.view viewWithTag:1209 + j];
                    contentlable.text = contentArr[j];
                    contentlable.hidden = NO;
                    
                    if (j == 0) {
                        titleLable.frame = CGRectMake(0, 110, 200, 30);
                        contentlable.frame = CGRectMake(200, 110, 155, 30);
                    }
                    else if (j == 1){
                        titleLable.frame = CGRectMake(0, 170, 200, 30);
                        contentlable.frame = CGRectMake(200, 170, 155, 30);
                    }
                    else if (j == 4){
                        titleLable.hidden = YES;
                        contentlable.hidden = YES;
                    }
                    else{
                        titleLable.frame = CGRectMake(0, 170 + j * 30, 200, 30);
                        titleLable.layer.borderWidth = 0.5;
                        
                        contentlable.frame = CGRectMake(200, 170 + j * 30, 155, 30);
                        contentlable.layer.borderWidth = 0.5;
                    }
                }
            }
            
        } failure:^(NSError *error) {
            NSLog(@"error : %@",error);
            [MBProgressHUD showError:@"网络连接失败"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
        }];
        
    }
    if (self.log == 1002) {
    }
    if (self.log == 1003) {
        UITextField *textField = [self.view viewWithTag:400];
        UITextField *textField1 = [self.view viewWithTag:401];
        UITextField *textField2 = [self.view viewWithTag:402];
        
        if (textField.tag == 400 && textField.text.length == 0) {
            NSLog(@"所在地区不为空 ");
            [MBProgressHUD showError:@"请选择所在地区"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        if (textField1.tag == 401 && textField1.text.length == 0){
            NSLog(@"案件类型不为空");
            [MBProgressHUD showError:@"请选择案件类型"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField2.tag == 402 && textField2.text.length == 0){
            NSLog(@"诉讼标的不为空");
            [MBProgressHUD showError:@"请填写诉讼标的"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        countView.hidden = NO;
        [MBProgressHUD showHUDAddedTo:self.view animated:YES];
        if (self.ajlxIndex == 0 || self.ajlxIndex == 2) {
            [NetworkingManager getUrl:LAWYERFEE_URL dic:@{@"df":@"1",@"fyflag":@"8",@"max":textField2.text} Succeed:^(id responseData) {
                
                NSLog(@"success : %@",responseData);
                NSDictionary *dic = [NSDictionary dictionary];
                dic = responseData[@"result"][0];
                
                NSString *minlsf = dic[@"fwsfmin"];
                NSString *maxlsf = dic[@"fwsfmax"];
                
                NSArray *titleArr = @[@"律师费：",@"",@""];
                NSArray *contentArr = @[[NSString stringWithFormat:@"%@元至%@元",minlsf,maxlsf],@"",@""];
                
                
                for (int i = 0; i < 3; i ++) {
                    UILabel *titleLable = [self.view viewWithTag:1300 + i];
                    titleLable.hidden = NO;
                    titleLable.text = titleArr[i];
                    
                    UILabel *contentLable = [self.view viewWithTag:1303 + i];
                    contentLable.text = contentArr[i];
                    contentLable.hidden = NO;
                    if (i > 0) {
                        titleLable.hidden = YES;
                        contentLable.hidden = YES;
                    }
                }
                
                [MBProgressHUD hideHUDForView:self.view animated:YES];
            } failure:^(NSError *error) {
                NSLog(@"error : %@",error);
                [MBProgressHUD showError:@"网络错误"];
                [MBProgressHUD hideHUDForView:self.view animated:YES];
            }];
        }
        if (self.ajlxIndex == 1 ) {
            NSArray *titleArr = @[@"侦查阶段：",@"侦查起诉阶段：",@"审判阶段："];
            NSMutableArray *contentArr = [NSMutableArray array];
                
            // 创建信号量
            dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
            // 创建全局并行
            dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
            dispatch_group_t group = dispatch_group_create();
            dispatch_group_async(group, queue, ^{
                    
                // 请求一
                [NetworkingManager getUrl:LAWYERFEE_URL dic:@{@"df":@"1",@"fyflag":@"9",@"max":textField2.text} Succeed:^(id responseData) {
                    [contentArr addObject:[NSString stringWithFormat:@"%@元至%@元",responseData[@"result"][0][@"fwsfmin"],responseData[@"result"][0][@"fwsfmax"]]];
                    NSLog(@"yue%@",responseData);
                    dispatch_semaphore_signal(semaphore);
                } failure:^(NSError *error) {
                        
                }];

            });
            dispatch_group_async(group, queue, ^{
                    
                // 请求二
                [NetworkingManager getUrl:LAWYERFEE_URL dic:@{@"df":@"1",@"fyflag":@"10",@"max":textField2.text} Succeed:^(id responseData) {
                    NSLog(@"yue1%@",responseData);
                    [contentArr addObject:[NSString stringWithFormat:@"%@元至%@元",responseData[@"result"][0][@"fwsfmin"],responseData[@"result"][0][@"fwsfmax"]]];
                    dispatch_semaphore_signal(semaphore);
                } failure:^(NSError *error) {
                        
                }];
            });
            dispatch_group_async(group, queue, ^{
                    
                // 请求三
                [NetworkingManager getUrl:LAWYERFEE_URL dic:@{@"df":@"1",@"fyflag":@"11",@"max":textField2.text} Succeed:^(id responseData) {
                    NSLog(@"yue2%@",responseData);
                    [contentArr addObject:[NSString stringWithFormat:@"%@元至%@元",responseData[@"result"][0][@"fwsfmin"],responseData[@"result"][0][@"fwsfmax"]]];
                    dispatch_semaphore_signal(semaphore);
                } failure:^(NSError *error) {
                        
                }];
            });
                
            dispatch_group_notify(group, queue, ^{
                    
                // 三个请求对应三次信号等待
                dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
                dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
                dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
                    
                //在这里 进行请求后的方法，回到主线程
                dispatch_async(dispatch_get_main_queue(), ^{
                        
                    //更新UI操作
                    NSLog(@"wancheng");
                    [MBProgressHUD hideHUDForView:self.view animated:YES];
                        
                        
                    for (int i = 0; i < 3; i ++) {
                        UILabel *titleLable = [self.view viewWithTag:1300 + i];
                        titleLable.hidden = NO;
                        titleLable.text = titleArr[i];
                    
                        UILabel *contentLable = [self.view viewWithTag:1303 + i];
                        contentLable.text = contentArr[i];
                        contentLable.hidden = NO;
                    }

                });
            });
        }
    }
    if (self.log == 1004) {
        UITextField *textField = [self.view viewWithTag:500];
        UITextField *textField1 = [self.view viewWithTag:501];
        
        if (textField.tag == 500 && textField.text.length == 0) {
            NSLog(@"案件类型不为空 ");
            [MBProgressHUD showError:@"请选择案件类型"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        if (textField1.tag == 501 && textField1.text.length == 0){
            NSLog(@"诉讼标的不为空");
            [MBProgressHUD showError:@"请填写诉讼标的"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        countView.hidden = NO;
        
        [MBProgressHUD showHUDAddedTo:self.view animated:YES];
        [NetworkingManager getUrl:LAWYERFEE_URL dic:@{@"df":@"0",@"fyflag":[NSString stringWithFormat:@"%ld",self.typeIndex + 1],@"max":textField1.text} Succeed:^(id responseData) {
            
            NSLog(@"success : %@",responseData);
            NSDictionary *dic = [NSDictionary dictionary];
            dic = responseData[@"result"][0];
            
            UILabel *titleLable = [self.view viewWithTag:1400];
            titleLable.text = @"受理费：";
            
            UILabel *contentLable = [self.view viewWithTag:1401];
            if (self.typeIndex == 1 || self.ajlxIndex == 2) {
                
                contentLable.text = [NSString stringWithFormat:@"%@元至%@元",dic[@"fwsfmin"],dic[@"fwsfmax"]];
            }
            else{
                contentLable.text = [NSString stringWithFormat:@"%@元",dic[@"fwsfmin"]];
            }
            

            [MBProgressHUD hideHUDForView:self.view animated:YES];
        } failure:^(NSError *error) {
            NSLog(@"error : %@",error);
            [MBProgressHUD showError:@"网络错误"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
        }];
        
        
    }
    if (self.log == 1005) {
        UITextField *textField = [self.view viewWithTag:600];
        UITextField *textField1 = [self.view viewWithTag:601];
        UITextField *textField2 = [self.view viewWithTag:602];
        UITextField *textField3 = [self.view viewWithTag:603];
        
        if (textField.tag == 600 && textField.text.length == 0) {
            NSLog(@"金额不为空 ");
            [MBProgressHUD showError:@"请填写金额"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        
        if (textField1.tag == 601 && textField1.text.length == 0){
            NSLog(@"历时几天不为空");
            [MBProgressHUD showError:@"请填写历史天数"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField2.tag == 602 && textField2.text.length == 0){
            NSLog(@"利率不为空");
            [MBProgressHUD showError:@"请填写利率"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        if (textField3.tag == 603 && textField2.text.length == 0){
            NSLog(@"利率类型不为空");
            [MBProgressHUD showError:@"请选择利率类型"];
            [MBProgressHUD hideHUDForView:self.view animated:YES];
            return;
        }
        countView.hidden = NO;
        if (self.rateTypeIndex == 0) {
            
            float deadLine = [textField1.text floatValue];
            float rate = [textField2.text floatValue] * 0.01;
            float dedit = [textField1.text floatValue] * deadLine * rate;
            
            NSArray *contentArr = @[[NSString stringWithFormat:@"%.2f 天 ",deadLine],[NSString stringWithFormat:@"%lf 每天 ",rate],[NSString stringWithFormat:@"%.2f 元 ",dedit]];
            
            NSLog(@"contentArr : %@",contentArr);
            for (int i = 0; i < 3; i ++) {
                UILabel *contentLable = [self.view viewWithTag:1603 + i];
                contentLable.text = contentArr[i];
            }
        }
        else if (self.rateTypeIndex == 1){
            float deadLine = [textField1.text floatValue];
            float rate = [textField2.text floatValue] * 0.003 ;
            float dedit = [textField1.text floatValue] * deadLine * rate;
            
            NSArray *contentArr = @[[NSString stringWithFormat:@"%.2f 天 ",deadLine],[NSString stringWithFormat:@"%lf 每天 ",rate],[NSString stringWithFormat:@"%.2f 元 ",dedit]];
            NSLog(@"contentArr : %@",contentArr);
            for (int i = 0; i < 3; i ++) {
                UILabel *contentLable = [self.view viewWithTag:1603 + i];
                contentLable.text = contentArr[i];
            }
        }
        else if (self.rateTypeIndex == 2){
            float deadLine = [textField1.text floatValue];
            float rate = [textField2.text floatValue] * 0.01 / 365;
            float dedit = [textField1.text floatValue] * deadLine * rate;
            
            NSArray *contentArr = @[[NSString stringWithFormat:@"%.2f 天 ",deadLine],[NSString stringWithFormat:@"%lf 每天 ",rate],[NSString stringWithFormat:@"%.2f 元 ",dedit]];
            NSLog(@"contentArr : %@",contentArr);
            for (int i = 0; i < 3; i ++) {
                UILabel *contentLable = [self.view viewWithTag:1603 + i];
                contentLable.text = contentArr[i];
            }
        }
    }
}


//- (void)action_ClickButton:(UIButton *)sender{
//
//    NSLog(@"tag = %ld",sender.tag);
//}
- (void)textFieldsDidClick:(UIButton *)sender{
    //    if (self.flag == 0) {
    NSLog(@"tag = %ld",sender.tag);
    if (sender.tag == 200) {
        self.seletTag = 200;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"重庆"];
        [self.view addSubview:picker];
    }
    if (sender.tag == 201) {
        self.seletTag = 201;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = self.scdjArr;
        [self.view addSubview:picker];
    }
        if (sender.tag == 400) {
        self.seletTag = 400;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = @[@"重庆"];
        [self.view addSubview:picker];
    }
    if (sender.tag == 401) {
        self.seletTag = 401;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = self.ajlxArr;
        [self.view addSubview:picker];
    }
    if (sender.tag == 500) {
        self.seletTag = 500;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self ;
        picker.selectLb.text = @"请选择";
        picker.customArr = self.typeArr;
        [self.view addSubview:picker];
    }
    if (sender.tag == 603) {
        self.seletTag = 603;
        JHPickView *picker = [[JHPickView alloc]initWithFrame:self.view.bounds];
        picker.delegate = self;
        picker.selectLb.text = @"请选择";
        picker.customArr = self.rateTypeArr;
        [self.view addSubview:picker];
    }
}
#pragma mark - UITextFiledDelegate
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    /*
     *  判断输入是否为小数
     */
    //     判断是否有小数点
    NSLog(@"tex = %@  ns = %@  让 = %ld",textField.text,string,range.location);
    if ([textField.text containsString:@"."])
    {
        isHaveDian = YES;
    }else{
        isHaveDian = NO;
        
    } if (string.length > 0) {
        //当前输入的字符
        unichar single = [string characterAtIndex:0];
        NSLog(@"single = %c",single);
        
        // 不能输入.0-9以外的字符
        if (!((single >= '0' && single <= '9') || single == '.')) {
            [self showMyMessage:@"您的输入格式不正确" ];
            return NO;
        }
        
        // 只能有一个小数点
        if (isHaveDian && single == '.') {
            [self showMyMessage:@"最多只能输入一个小数点" ];
            return NO;
        }
        // 如果第一位是.则前面加上0.
        if ((textField.text.length == 0) && (single == '.')) {
            
            textField.text = @"0";
        }
        
        // 如果第一位是0则后面必须输入点，否则不能输入。
        if ([textField.text hasPrefix:@"0"]) {
            
            NSLog(@"tex = %@  ns = %@",textField.text,string);
            //            textField.text = @".";
            if (textField.text.length > 1) {
                NSString *secondStr = [textField.text substringWithRange:NSMakeRange(1, 1)];
                if (![secondStr isEqualToString:@"."]) {
                    [self showMyMessage:@"第二个字符需要是小数点" ];
                    return NO;
                }
            }else{
                if (![string isEqualToString:@"."]) {
                    [self showMyMessage:@"第二个字符需要是小数点" ];
                    return NO;
                }
            }
        }
        // 小数点后最多能输入两位
        if (isHaveDian) {
            NSRange ran = [textField.text rangeOfString:@"."];
            // 由于range.location是NSUInteger类型的，所以这里不能通过(range.location - ran.location)>2来判断
            if (range.location > ran.location) {
                if ([textField.text pathExtension].length > 1) {
                    [self showMyMessage:@"小数点后最多有两位小数" ];
                    return NO;
                }
            }
        }
    }
    
    return YES;
   
}

-(void)showMyMessage:(NSString*)aInfo {
    
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:aInfo delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    
    [alertView show];
    
}

#pragma mark - JHPickerViewDelegate
-(void)PickerSelectorIndixString:(NSString *)str
{
    //是否包含
    if ([self.scdjArr containsObject:str]) {
        self.scdjIndex = [self.scdjArr indexOfObject:str];
        NSLog(@"scdj = %ld",self.scdjIndex);
    }
    else if ([self.ajlxArr containsObject:str]){
        self.ajlxIndex = [self.ajlxArr indexOfObject:str];
        NSLog(@"ajlx = %ld",self.ajlxIndex);
    }else if ([self.typeArr containsObject:str]){
        self.typeIndex = [self.typeArr indexOfObject:str];
        NSLog(@"type = %ld",self.typeIndex);
    }else if ([self.rateTypeArr containsObject:str]){
        self.rateTypeIndex = [self.rateTypeArr indexOfObject:str];
        NSLog(@"rateType = %ld",self.rateTypeIndex);
    
    
    }
    self.selectStr = str ;
    NSLog(@"str = %@",self.selectStr);
    UITextField *textfield = [self.view viewWithTag:self.seletTag];
    textfield.text = str;
}
#pragma mark - Getter
- (NSArray *)scdjArr{
    if (!_scdjArr) {
        _scdjArr = @[@"一级",@"二级",@"三级",@"四级",@"五级",@"六级",@"七级",@"八级",@"九级",@"十级",@"工亡"];
    }
    return _scdjArr;
}
- (NSArray *)ajlxArr{
    if (!_ajlxArr) {
        _ajlxArr = @[@"民事",@"刑事",@"行政"];
    }
    return _ajlxArr;
}
- (NSArray *)typeArr{
    if (!_typeArr) {
        _typeArr = @[@"财产案件",@"离婚案件",@"人格权案件",@"知识产权民事案件",@"劳动争议案件",@"商标专利海事专利行政案件",@"其他行政案件"];
    }
    return _typeArr;
}
- (NSArray *)rateTypeArr{
    if (!_rateTypeArr) {
        _rateTypeArr = @[@"日利率",@"月利率",@"年利率"];
    }
    return _rateTypeArr;
}
- (NSDictionary *)log_Type{
    if (!_log_Type) {
        _log_Type = [NSDictionary dictionaryWithObjectsAndKeys:@"1",@"客户拜访",@"2",@"商务谈判",@"3",@"法律咨询",@"4",@"案例/资料检索",@"5",@"法律文书起草/修改",@"6",@"调查取证",@"7",@"案件研讨",@"8",@"刑案律师会见",@"9",@"诉讼/仲裁出庭",@"10",@"信访/社区/法援律师值班", nil];
    }
    return _log_Type;
}
- (NSDictionary *)charge_Type{
    if (!_charge_Type) {
        _charge_Type = [NSDictionary dictionaryWithObjectsAndKeys:@"1",@"预收款",@"2",@"追加费用",@"3",@"尾款",@"4",@"退款", nil];
    }
    return _charge_Type;
}
- (NSDictionary *)pay_Type{
    if (!_pay_Type) {
        _pay_Type = [NSDictionary dictionaryWithObjectsAndKeys:@"1",@"现金",@"2",@"刷卡", nil];
    }
    return _pay_Type;
}
- (NSArray *)titleArray{
    if (!_titleArray) {
        if (self.log == 1000) {
            _titleArray = [NSArray arrayWithObjects:@"贷 款 金 额（元）：",@"还 款 期 限  ：",@"利           率  ：",nil];
            
        }
        else if (self.log == 1001){
            _titleArray = [NSArray arrayWithObjects:@"所 在 地 区  ：",@"伤 残 等 级  ：",@"月工资（元）：",nil];
        }
        else if (self.log == 1002){
            _titleArray = [NSArray arrayWithObjects:@"所 在 地 区  ：",@"伤 残 等 级  ：",@"月工资（元）：",nil];
        }
        else if (self.log == 1003){
            _titleArray = [NSArray arrayWithObjects:@"所 在 地 区  ：",@"案 件 类 型  ：",@"诉 讼 标 的（元）：",nil];
        }
        else if (self.log == 1004){
            _titleArray = [NSArray arrayWithObjects:@"案 件 类 型  ：",@"诉 讼 标 的（元）：",nil];
        }
        else if (self.log == 1005){
            _titleArray = [NSArray arrayWithObjects:@"金额（元）  ：",@"历 时 几 天  ：",@"利           率  ：",@"选择利率方式：",nil];
        }
        
        
    }
    return _titleArray;
}
- (NSArray *)imageArray{
    if (!_imageArray) {
        if (self.log == 1000) {
            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",@"llist_03",nil];
        }
        else if (self.log == 1001) {
            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",@"llist_03",nil];
        }
        else if (self.log == 1002) {
            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",@"llist_03",nil];
        }
        else if (self.log == 1003) {
            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",@"llist_03",nil];
        }
        else if (self.log == 1004) {
            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",nil];
        }
        else if (self.log == 1005) {
            _imageArray = [NSArray arrayWithObjects:@"llist_01",@"llist_02",@"llist_02",@"llist_02",nil];
        }
        
    }
    return _imageArray;
}
- (NSArray *)placeHolderArray{
    if (!_placeHolderArray) {
        if (self.log == 1000) {
            _placeHolderArray = [NSArray arrayWithObjects:@"请输入贷款金额",@"请填写还款期限（月）",@"请填写利率（分）",nil];
        }
        else if (self.log == 1001) {
            _placeHolderArray = [NSArray arrayWithObjects:@"请选择所在地区",@"请选择伤残等级",@"请填写月工资（元）",nil];
        }
        else if (self.log == 1002) {
            _placeHolderArray = [NSArray arrayWithObjects:@"请点撒",@"请点撒",@"请点撒",nil];
        }
        else if (self.log == 1003) {
            _placeHolderArray = [NSArray arrayWithObjects:@"请选择所在地区",@"请选择案件类型",@"请填写诉讼标的金额（元）",nil];
        }
        else if (self.log == 1004) {
            _placeHolderArray = [NSArray arrayWithObjects:@"请选择案件类型",@"请输入诉讼标的金额（元）",nil];
        }
        else if (self.log == 1005) {
            _placeHolderArray = [NSArray arrayWithObjects:@"请输入本金",@"请填写历时时间（天）",@"请填写利率（分）",@"请选择利率方式",nil];
        }
        
    }
    return _placeHolderArray;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
